## Calling Sound Functions

##### (1) Make the following declaration.

      #include "sound file directory /4aLib.h"

##### (2) Run the following with the initialization routine following a reset.

Initialize the sound function I/O and set aside the work areas.

       m4aSoundInit();

##### (3) Call the following function immediately after every V-Blank interrupt.

The timing on this is very tight. It would be ideal to call this before any other process.
Note that the process itself is extremely short.

       m4aSoundVSync();

##### (4) Call the following function during every V-Blank period (1/60 of a second).

There is no need to be concerned about the timing of this. It can be called after all processsing besides that for other songs, has been completed.

       m4aSoundMain();

##### (5) To start playing song number n, call the following function.

       m4aSongNumStart( n );

##### (6) Functions Other Than Those Above

Please refer to the AGB Music Player Programmer's Manual for more information on functions.

       m4aSoundMode();    Operation Mode Settings

       m4aSoundVSyncOff();    Stop Sound DMA

       m4aSoundVSyncOn();       Restart Sound DMA

       m4aMPlayStart();       Start Playing by Song Name

       m4aSongNumStartOrChange();       Change/Start Playing by Song#

       m4aSongNumStartOrContinue();       Start/Restart Playing by Song#

       m4aMPlayStop();       Stop (Pause) Song

       m4aSongNumStop();       Stop (Pause) by Song Number

       m4aMPlayAllStop();       Stop (Pause) All Songs

       m4aMPlayContinue();       Restart Song

       m4aSongNumContinue();       Restart by Song Number

       m4aMPlayAllContinue();      Restart Play of All Songs

       m4aMPlayFadeOut();       Fade Out Song

       m4aMPlayTempoControl();       Change Tempo

       m4aMPlayVolumeControl();       Change Volume

       m4aMPlayPitchControl();       Change Scale

       m4aMPlayPanpotControl();       Change Normal Position

       m4aMPlayModDepthSet();       Change Modulation Depth

       m4aMPlayLFOSpeedSet();       Change Modulation Speed

       m4aMPlayImmInit();      Immediately Initialize Song Plan to Start Playing

Back:[ Incorporating Sound Objects into Games ] TOP :[ Table of Contents ]